from rest_framework import serializers

from user.models import user, book


class bookserializer(serializers.ModelSerializer):
    class Meta:
        model = book
        fields = '__all__'

class userserializer(serializers.ModelSerializer):
    type = bookserializer(read_only=True)
    type_id=serializers.IntegerField(write_only=True)
    class Meta:
        model = user
        fields = '__all__'